//
//  SimpleCalculatorEngineTests.m
//  ModuleTesting
//
//  Created by duc nguyen van on 8/4/11.
//  Copyright 2011 STU. All rights reserved.
//

#import "GTMSenTestCase.h"
#import "SimpleCalculatorEngine.h"

@interface SimpleCalculatorEngineTests : GTMTestCase
{
	
}

- (void)testNullExpression;

@end

@implementation SimpleCalculatorEngineTests
- (void)testNullExpression
{
	SimpleCalculatorEngine* engine = [[SimpleCalculatorEngine alloc] init];
	
	[engine sendCommand:@""];

	NSString* result = [engine getCurrentResult];
	
	STAssertEqualStrings(result, @"0", @"");
}

- (void) testCharacterExpression
{
	SimpleCalculatorEngine* engine = [[SimpleCalculatorEngine alloc]init];
	
	[engine sendCommand:@"h"];
	
	NSString* resault = [engine getCurrentResult];

	STAssertEqualStrings(resault,@"0", @"");	
}

- (void) testCurrentResault
{
	SimpleCalculatorEngine* engine = [[SimpleCalculatorEngine alloc]init];
	
	[engine sendCommand:@"h"];
	NSString *t = [engine getCurrentResult];
	
	//NSString* resault = [engine getCurrentResult];
	
	STAssertEqualStrings(t,@"1", @"* Error");
}

@end
